home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PASCSRC.ZIP / ALLVAR.PAS next >
Pascal/Delphi Source File  |  1988-01-15  |  937b  |  29 lines

  1.                                 (* Chapter 3 - Program 3 *)
  2. program All_Simple_Variable_Types;
  3.  
  4. var  A,B         : integer;
  5.      C,D         : byte;
  6.      Dog_Tail    : real;
  7.      Puppy       : boolean;
  8.      Animal_Cookies : char;
  9.  
  10. begin
  11.    A := 4;
  12.    B := 5;
  13.    C := 212;
  14.    D := C + 3;
  15.    Dog_Tail := 345.12456;
  16.    Puppy := B > A;  (* since B is greater than A, Puppy
  17.                        will be assigned the value TRUE *)
  18.    Animal_Cookies := 'R';  (* this is a single character *)
  19.  
  20.    Writeln('The integers are',A:5,B:5);
  21.    Writeln('The bytes are',   C:5,D:5); (* notice that the spaces
  22.                                            prior to the C will be
  23.                                            ignored on output *)
  24.    Writeln('The real value is',Dog_Tail:12:2,Dog_Tail:12:4);
  25.    Writeln;
  26.    Writeln('The boolean value is ',Puppy,Puppy:13);
  27.    Writeln('The char variable is an ',Animal_Cookies);
  28. end.
  29.